package com.innovation.chengzhangriji.http;

import com.google.gson.annotations.SerializedName;
import com.innovation.library.http.InnovationRequestBody;

public class SyncLastDataRequest extends BaseDataRequest{

    public static final String PATH = BaseRequest.PATH + "api/get_old_diaries";

    private long createTS;

    @Override
    protected InnovationRequestBody getInnovationRequestBody() {
        SyncLastDataRequestBody body = new SyncLastDataRequestBody();
        body.setPhone(getPhone());
        body.setToken(getToken());
        body.setId(getId());
        body.setLength(getLength());
        body.setServerTime(getServerTime());
        body.setCreateTS(getCreateTS());
        return body;
    }

    public long getCreateTS() {
        return createTS;
    }

    public void setCreateTS(long createTS) {
        this.createTS = createTS;
    }

    private class SyncLastDataRequestBody extends BaseDataRequestBody {

        @SerializedName("OldTS")
        private long createTS;

        public SyncLastDataRequestBody() {
            setSv(BaseRequestConfig.SV_DATA_GET_OLD);
        }

        public long getCreateTS() {
            return createTS;
        }

        public void setCreateTS(long createTS) {
            this.createTS = createTS;
        }
    }
}
